// TableManage.cpp: implementation of the TableManage class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "TableManage.h"

#include "PathManager.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

TableManage::TableManage(const StdString& strFEquipName,const StdString& strTable)
{
	StdString strSource = PathManager::Instance()->GetEquipSource();
	ASSERT(!strFEquipName.IsEmpty());
	ASSERT(!strTable.IsEmpty());
	ASSERT(!strSource.IsEmpty());

//	m_strFEquipName = strFEquipName;
//	m_strSource = strSource;
//	m_strTable = strTable;
	UEConnectionPtr pConnectionPtr = UEConnectionManager::Instance().GetConnection(strSource);
    m_ptrSet = pConnectionPtr->ExecuteSelectSQL(_T("select * from "+strTable+" where ID='"+strFEquipName+"'"));

}

TableManage::~TableManage()
{

}


StdString TableManage::GetScriptTable()
{
	ASSERT(!m_ptrSet->IsEmpty());
	return m_ptrSet->GetString(_T("ScriptTable"));
}

StdString TableManage::GetPropertyTable()
{
	ASSERT(!m_ptrSet->IsEmpty());
	return m_ptrSet->GetString(_T("PropertyTable"));
}

StdString TableManage::GetFunctionTable()
{
	ASSERT(!m_ptrSet->IsEmpty());
	return m_ptrSet->GetString(_T("FunctionTable"));
}